
<div class="pagination">
    <span class="step-links">
        {% if page_obj.has_previous %}
            <a href="?page=1">&laquo; На первую страницу</a>
            <a href="?page={{ page_obj.previous_page_number }}">Назад</a>
        {% endif %}

        <span class="current">
            Page {{ page_obj.number }} of {{ page_obj.paginator.num_pages }}.
        </span>

        {% if page_obj.has_next %}
            <a href="?page={{ page_obj.next_page_number }}">Вперед</a>
            <a href="?page={{ page_obj.paginator.num_pages }}">На последнюю страницу &raquo;</a>
        {% endif %}
    </span>
</div>
